package com.yu.blog.entities.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yu.blog.entities.baseEntity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Validated
@TableName("p_blog")
@Schema(description = "博客内容")
public class Blog  extends BaseEntity implements Serializable {


    @Schema(description = "博客标题")
    @TableField("blog_title")
    @NotBlank(message = "博客标题不能为空")
    private String title;
    @Schema(description = "博客内容")
    @TableField("blog_context")
    @NotEmpty(message = "博客内容不能为空")
    private String content;
    @Schema(description = "内容描述")
    @TableField("description")
    private String description;
}
